package com.example.orderconsumer.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Service
@FeignClient(
        value = "inventory-service",
        fallbackFactory = com.example.orderconsumer.config.InventoryServiceFallbackFactory.class
)
public interface InventoryService {
    @RequestMapping("/inventory/lock/{productId}/{quantity}")
    Boolean lockStock(@PathVariable("productId") Long productId, @PathVariable("quantity") Integer quantity);

    @RequestMapping("/inventory/release/{productId}/{quantity}")
    Boolean releaseStock(@PathVariable("productId") Long productId, @PathVariable("quantity") Integer quantity);
}